package cn.webestar.scms.user.svcapi;

import cn.webestar.scms.commons.R;
import cn.webestar.scms.commons.api.PageVO;
import cn.webestar.scms.microsvc.controller.BaseController;
import cn.webestar.scms.user.api.SysDictApi;
import cn.webestar.scms.user.api.dto.SysDict.*;
import cn.webestar.scms.user.entity.SysDict;
import cn.webestar.scms.user.service.SysDictService;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 字典
 */
@RestController
@RequestMapping("/svcapi/SysDict")
public class SysDictSvcController extends BaseController<SysDict, Long> implements SysDictApi {

    @Autowired
    private SysDictService service;

    @Override
    public IService<SysDict> getService() {
        return service;
    }

    @Override
    @PostMapping("/delete")
    public R<Boolean> delete(@RequestParam("id") Long id) {
        return super._delete(id);
    }

    @Override
    @PostMapping("/findById")
    public R<SysDict> findById(@RequestParam("id") Long id) {
        return super._findById(id);
    }

    @Override
    @PostMapping("/findByIds")
    public R<Map<Long, SysDict>> findByIds(@RequestBody Set<Long> ids) {
        return super._findByIds(ids);
    }

    @Override
    @PostMapping("/create")
    public R<SysDict> create(@RequestBody SysDictCreateDTO body) {
        return super._create(body);
    }

    @Override
    @PostMapping("/update")
    public R<SysDict> update(@RequestBody SysDictUpdateDTO body) {
        return super._update(body);
    }

    @Override
    @PostMapping("/page")
    public R<PageVO<SysDict>> page(@RequestBody SysDictPageDTO body) {
        return super._page(body);
    }

    @Override
    @PostMapping("/findOne")
    public R<SysDict> findOne(@RequestBody SysDictSimpleDTO body) {
        return super._findOne(body);
    }

    @Override
    @PostMapping("/limitList")
    public R<List<SysDict>> limitList(@RequestBody SysDictLimitDTO body) {
        return super._limitList(body);
    }

}
